package nz.ac.massey.doi_information_extractor.main;

import java.io.File;

import javax.swing.filechooser.FileFilter;

/**
 * File filter for the save file dialog
 *
 */
public class PdfFileFilter extends FileFilter{

    private String description;
    private String extension;


    public PdfFileFilter() {
        extension = ".pdf";
        description = "PDF File (*.pdf)";
    }

    public boolean accept(File file) {
        if (file == null) {
            return false;
        }

        if(file.isDirectory())
        	return false;

        return file.getName().toLowerCase().endsWith(extension);
    }

    public String getDescription() {
        return description;
    }
}
